New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aws-dynamodb-lambda-trigger

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-dynamodb-lambda-trigger

clean dynamo triggers

  • 4.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-58.33%
Maintainers
1
Weekly downloads
 
Created
Source

aws-dynamodb-lambda-trigger

Cleans up the code you need to run a DynamoDB trigger on AWS Lambda.

var trigger = require('aws-dynamodb-lambda-trigger')

// regular lambda fn business here
exports.handler = function myLambdaTriggerForTableName(event, context) {

  // register a handler for inserts
  trigger.insert(event, context, function handleInsert(record, callback) {
    console.log(record)
    callback()
  })
}

api

  • trigger.insert(event, context, handler) register a handler for INSERT
  • trigger.modify(event, context, handler) register a handler for MODIFY
  • trigger.remove(event, context, handler) register a handler for REMOVE
  • trigger.all(event, context, handler) register a handler for INSERT, MODIFY and REMOVE
  • trigger.save(event, context, handler) register a handler for INSERT, MODIFY
  • trigger.change(event, context, handler) register a handler for INSERT and REMOVE

In all cases the handler is a function with the following signature:

function handleSave(record, callback) {
  // do something with record and then callback node-style
  // if an err is passed to the callback it will be passed to context.fail
  callback(null, record)
}

even CLEANER api

var trigger = require('aws-dynamodb-lambda-trigger/lambda')

// runs on every record inserted
function handler(record, callback) {
  callback()
}

exports.handler = trigger.insert(handler)

Keywords

FAQs

Package last updated on 05 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc